using ASP;
using HoWave.Web;
using HoWave.Web.Shop.Member;
using System;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI.WebControls;
public class Member_Shop_Request : Member, IRequiresSessionState
{
	protected Button RequestIngProducList;
	protected Button RequestOverProducList;
	protected GridView GridView1;
	protected Button Del_Button1;
	protected ObjectDataSource ObjectDataSource1;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		this.ObjectDataSource1.SelectParameters["UserID"].DefaultValue = base.user.UserID.ToString();
	}
	protected void ShowRequestType(object sender, CommandEventArgs e)
	{
		this.ObjectDataSource1.SelectParameters["Type"].DefaultValue = e.CommandName;
		this.GridView1.DataBind();
	}
	protected void Del_Button1_Click(object sender, EventArgs e)
	{
		string text = "";
		foreach (GridViewRow gridViewRow in this.GridView1.Rows)
		{
			CheckBox checkBox = (CheckBox)gridViewRow.FindControl("SelectProduct");
			if (checkBox.Checked)
			{
				text = text + gridViewRow.Cells[0].Text + ",";
			}
		}
		if (text.Length > 1)
		{
			text = text.Remove(text.Length - 1);
			Shop_Request shop_Request = new Shop_Request();
			shop_Request.DeleteRequest(text);
			this.ObjectDataSource1.Update();
		}
	}
	protected void GridView1_DataBound(object sender, EventArgs e)
	{
		foreach (GridViewRow gridViewRow in this.GridView1.Rows)
		{
			HyperLink hyperLink = (HyperLink)gridViewRow.FindControl("ProductEdit");
			hyperLink.NavigateUrl = "../shop_request_productEdit.aspx?RequestProductID=" + gridViewRow.Cells[0].Text;
		}
	}
}
